<h2>DESCRIPTION</h2>

<em>i.gensig</em>
is a non-interactive method for generating input into 
<em><a href="i.maxlik.html">i.maxlik</a></em>.
It can be used as the first pass in the GRASS two-pass 
classification process (instead of 
<em><a href="i.cluster.html">i.cluster</a></em>
 or 
<em><a href="g.gui.iclass.html">g.gui.iclass</a>)</em>.

It reads a raster map layer, called the training map, which
has some of the pixels or regions already classified.
<em>i.gensig</em> will then extract spectral signatures
from an image based on the classification of the pixels in
the training map and make these signatures available to
<em><a href="i.maxlik.html">i.maxlik</a></em>.

<p>
The user would then execute the GRASS program 
<em><a href="i.maxlik.html">i.maxlik</a></em>
to actually create the final classified map.

<p>
All raster maps used to generate signature file must have band reference
set. Use <em><a href="r.support.html">r.support</a></em> to set
band references of each member of the imagery group.
Signatures generated for one scene are suitable for classification
of other scenes as long as they consist of same raster bands
(band references match).

<h2>OPTIONS</h2>

<h3>Parameters</h3>

<dl>
<dt><b>trainingmap=</b><em>name</em>
<dd>ground truth training map
<p>
This map must be prepared by the user in advance using vector or
raster digitizer. Of course other methods could be devised by the user
for creating this training map - <em>i.gensig</em> makes no assumption
about the origin of this map layer. It simply creates signatures for
the classes defined in the training map for the image to be classified
(the image is specified in other options - see below). The
<em><a href="wxGUI.vdigit.html">wxGUI vector digitizer</a></em> can be
used for interactively creating the training map.

<dt><b>group=</b><em>name</em> 
<dd>imagery group
<p>
This is the name of the group that contains the band files
which comprise the image to be analyzed. The <em>
<a href="i.group.html">i.group</a> </em> command is
used to construct groups of raster layers which comprise an
image.

<p>
<dt><A NAME="subgroup"></a><b>subgroup=</b><em>name</em>

<dd>subgroup containing image files
<p>
This names the subgroup within the group that selects a
subset of the bands to be analyzed. The <em>
<a href="i.group.html">i.group</a> </em> command is
also used to prepare this subgroup.  The subgroup mechanism
allows the user to select a subset of all the band files
that form an image.


<dt><b>signaturefile=</b><em>name</em> 
<dd>resultant signature file
<p>
This is the resultant signature file (containing the means
and covariance matrices) for each class in the training map
that is associated with the band files in the subgroup
select (see <a href="#subgroup">above</a>). Resultant singature file
can be used with any other imagery group as long as band references
match.
</dl>

<h2>NOTES</h2>

The structure of the SIG files generated by <em>i.gensig</em> is
as follows (ASCII file, used internally by <em>i.maxlik</em>):
<br>
<i>Note: the line numbers are not present in the file but have been
added here for explanation only</i>:
<p>
SIG file "lsat7_2000_gensig":
<div class="code"><pre>
 1 1
 2 #
 3 Band_reference1
 4 #water
 5 4186
 6 67.9508 48.7346 37.8915 15.3129 13.8473 12.0855 
 7 1.74334 
 8 0.439504 2.07267 
 9 0.662523 1.63501 4.21189 
10 0.530339 2.40757 5.52857 22.433 
11 0.561184 2.30762 5.18846 20.5364 20.4926 
12 0.393218 1.2184 2.63628 9.61528 9.36025 5.85314 
</pre></div>

<ul>
<li> Line 1: version number (currently always 1)
<li> Line 2: text label
<li> Line 3: Space separated list of band references
<li> Line 4: text label of class
<li> Line 5: number of points in class
<li> Line 6: mean values per band of the class
<li> Line 7-12: (semi)-matrix of band-band covariance
</ul>

<h2>SEE ALSO</h2>

<em>
<a href="r.support.html">r.support</a>,
<a href="g.gui.iclass.html">g.gui.iclass</a>,
<a href="i.group.html">i.group</a>,
<a href="i.cca.html">i.cca</a>,
<a href="i.maxlik.html">i.maxlik</a>,
<a href="i.smap.html">i.smap</a>,
<a href="r.info.html">r.info</a>,
<a href="r.univar.html">r.univar</a>,
<a href="wxGUI.vdigit.html">wxGUI vector digitizer</a>
</em>

<h2>AUTHOR</h2>

Michael Shapiro,
U.S.Army Construction Engineering Research Laboratory
<br>
Band reference support: Maris Nartiss,
University of Latvia

<!--
<p>
<i>Last changed: $Date$</i>
-->
